package org.jgs1904.practice;

import org.jgs1904.utils.UnicodeUtil;

/**
 * @author: 默苍璃
 * @date: 2022-09-07 10:27
 * <p>
 * 将一组int值视为字符的Unicode编码，然后将它们拼成一个字符串
 */
public class JoinChar {

    public static void main(String[] args) {
        // 请将下面一组int值视为字符的Unicode码，把它们拼成一个字符串：
        int a = 72;
        int b = 105;
        int c = 65281;

        char a1 = '\u0048';
        char b1 = '\u0069';
        char c1 = '\uFF01';
        System.out.print(a1);
        System.out.print(b1);
        System.out.println(c1);

        System.out.println(UnicodeUtil.char2Unicode(a1));

        char a2 = (char) a;
        char b2 = (char) b;
        char c2 = (char) c;
        System.out.print(a2);
        System.out.print(b2);
        System.out.println(c2);

        String s = "" + a1 + b1 + c1;
        String s2 = "" + a2 + b2 + c2;
        System.out.println(s);
        System.out.println(s2);

        String s1 = Integer.toHexString(a);
        System.out.println(s1);

    }

}
